/*
 * @Author: wuqingchun
 * @Date: 2023-08-18 17:00:54
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-01-11 14:40:51
 */
#ifndef __FTPC_UTIL_H__
#define __FTPC_UTIL_H__

#include <netinet/in.h>
#include "ftpc.h"

int FTPC_util_GetLocalAddr(const struct in_addr* pstAddr, struct in_addr* pstOutAddr);

// 设置描述符为非阻塞模式
int FTPC_util_SetNoBlock(int iFd);

int FTPC_util_ParseLine(FTPC_CMD_INFO_S* pstCmdInfo, char* pcLine);
int FTPC_util_ReadLine(FTPC_CMD_INFO_S* pstCmdInfo, char **ppcLine);
int FTPC_util_GetUserInput(const char* pcPrompt, FTPC_CMD_INFO_S* pstCmdInfo);

// 开启直接 IO 模式
int FTPC_util_EnableDirectIO(int iFd);

#endif //__FTPC_UTIL_H__